<template>
  <f7-page>
    <f7-navbar title="查询结果" back-link="Back"></f7-navbar>
    <f7-list v-for="(customer, index) in object" :key="index" media-list>
      <f7-list-item
        swipeout
        :title="customer.number"
        :after="customer.Checkintime"
        :subtitle="customer.departuretime"
      ></f7-list-item>
    </f7-list>
  </f7-page>
</template>
<script>
import { mapState } from "vuex";

import axios from "axios";
export default {
  data() {
    return {
      object: []
    };
  },
  mounted() {
    this.selectRoom();
  },
  methods: {
    selectRoom() {
      const self = this;
      const app = self.$f7;
      URL = "/caofuying/RoomOrder/selectRoomOrder";
      axios
        .get(URL, {
          params: {
            name: this.$store.state.apiDocInfo.name,
            phoplenumber: this.$store.state.apiDocInfo.phoplenumber,
            idcard: this.$store.state.apiDocInfo.idcard
          }
        })
        .then(r => {
          const { data } = r;
          if (data != null) {
            this.object = data;
          } else {
            app.dialog.alert("服务器错误");
          }
        });
    }
  }
};
</script>
